<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/head :: head(links)"/>
<body>
<div class="ok-body" id="app" v-cloak>
    <template>
        <i-form ref="checkForm" :model="nature" :rules="ruleValidate" :label-width="100">
<!--             <form-item prop="id" label="id：">-->
<!--                 <i-input maxlength="20" v-model="nature.id" placeholder="请输入id"></i-input>-->
<!--             </form-item>-->
<!--             <form-item prop="companyProfile" label="公司简介：">-->
<!--                 <i-input maxlength="2000" v-model="nature.companyProfile" placeholder="请输入公司简介"></i-input>-->
<!--             </form-item>-->
             <form-item prop="foundedIn" label="始创于：">
                 <i-input maxlength="20" v-model="nature.foundedIn" placeholder="请输入始创于"></i-input>
             </form-item>
             <form-item prop="peopleNumber" label="从业人员数量：">
                 <i-input maxlength="20" v-model="nature.peopleNumber" placeholder="请输入从业人员数量"></i-input>
             </form-item>
             <form-item prop="seniorEngineerNumber" label="高级工程师数量：">
                 <i-input maxlength="20" v-model="nature.seniorEngineerNumber" placeholder="请输入高级工程师数量"></i-input>
             </form-item>
             <form-item prop="registeredEngineerNumber" label="国家注册工程师数量：">
                 <i-input maxlength="20" v-model="nature.registeredEngineerNumber" placeholder="请输入国家注册工程师数量"></i-input>
             </form-item>
<!--             <form-item prop="createTime" label="创建时间：">-->
<!--                 <i-input maxlength="20" v-model="nature.createTime" placeholder="请输入创建时间"></i-input>-->
<!--             </form-item>-->
<!--             <form-item prop="updateTime" label="最后更新时间：">-->
<!--                 <i-input maxlength="20" v-model="nature.updateTime" placeholder="请输入最后更新时间"></i-input>-->
<!--             </form-item>-->
<!--             <form-item prop="createUid" label="创建人id：">-->
<!--                 <i-input maxlength="20" v-model="nature.createUid" placeholder="请输入创建人id"></i-input>-->
<!--             </form-item>-->
<!--             <form-item prop="updateUid" label="最后更新人id：">-->
<!--                 <i-input maxlength="20" v-model="nature.updateUid" placeholder="请输入最后更新人id"></i-input>-->
<!--             </form-item>-->
        </i-form>
    </template>
</div>
<div th:replace="common/foot :: foot(script)"></div>
<script th:inline="none">
var vm = new Vue({
    el: '#app',
    data:{
        nature:{},
        ruleValidate : {
                 // id: [
                 //    { required: true, message: 'id不能为空', trigger: 'blur' }
                 // ],
                 companyProfile: [
                    { required: true, message: '公司简介不能为空', trigger: 'blur' }
                 ],
                 foundedIn: [
                    { required: true, message: '始创于不能为空', trigger: 'blur' }
                 ],
                 peopleNumber: [
                    { required: true, message: '从业人员数量不能为空', trigger: 'blur' }
                 ],
                 seniorEngineerNumber: [
                    { required: true, message: '高级工程师数量不能为空', trigger: 'blur' }
                 ],
                 registeredEngineerNumber: [
                    { required: true, message: '国家注册工程师数量不能为空', trigger: 'blur' }
                 ],
                 // createTime: [
                 //    { required: true, message: '创建时间不能为空', trigger: 'blur' }
                 // ],
                 // updateTime: [
                 //    { required: true, message: '最后更新时间不能为空', trigger: 'blur' }
                 // ],
                 // createUid: [
                 //    { required: true, message: '创建人id不能为空', trigger: 'blur' }
                 // ],
                 // updateUid: [
                 //    { required: true, message: '最后更新人id不能为空', trigger: 'blur' }
                 // ],
		}
    },
    methods: {
        acceptClick : function(dialog){
          vm.$refs.checkForm.validate(function(valid){
            if (valid) {
                layui.use(["okUtils", "okLayer"], function () {
                     okUtils = layui.okUtils;
                     okLayer = layui.okLayer;
                     okUtils.ajaxCloud({
                        url:"/base/nature/save",
                        param : vm.nature,
                        json:true,
                        success : function(result) {
                             okLayer.msg.greenTick(result.msg, function () {
                                  dialog.load();
                             })
                        }
                    });
                });
            }
          });
	    }
    },
    created: function() {

    }
});
</script>
</body>
</html>
